# coding: utf-8

import time
import main
import asyncio
import _thread
timeleft = 0
# 为线程定义一个函数
def counttime():
    global timeleft
    if timeleft != 0:
        timeleft = timeleft - 1
        print("timenow" , timeleft)
        time.sleep(1)
        counttime()
# 创建两个线程
try:
   _thread.start_new_thread( counttime, ("Thread-1", 2, ) )
except:
   print ("Error: 无法启动线程")






def addtime():
        g.timeleft = 120

def chushihua():
    global flag
    if flag:
        g.timeleft = 0
        flag=False



if __name__ == '__main__':
    app.run(debug=True, host='127.0.0.1', port=8081)





